﻿@using MvcAuthSample.Models;
@model ConsentViewModel
<p>consent page</p>
<div class="row page-header">
    <div class="col-sm-10">

        @if (!string.IsNullOrWhiteSpace(Model.ClientLogoUrl))
        {
            <div class=""><img src="@Model.ClientLogoUrl" width="200" /></div>
        }
        <h1>
            @Model.ClientName
            <small>希望使用你的账号</small>
        </h1>
    </div>

</div>

<div class="row">

    <div class="col-sm-8">
        <form asp-action="index" method="post">
            <input type="hidden" asp-for="ReturnUrl" />
            @if (!ViewContext.ModelState.IsValid)
            {
                <div class="alert alert-danger">
                    <strong>Error</strong>
                    <div asp-validation-summary="All" class="danger"></div>
                </div>
            }
            @if (Model.IdentiryScopes.Any())
            {
                <ul class="list-group">
                    @foreach (var scope in Model.IdentiryScopes)
                    {
                        @Html.Partial("_ScopeListitem", scope);
                    }
                </ul>
            }
            @if (Model.ResourceScopes.Any())
            {
                <div class="panel">
                    <div class="panel-heading">
                        <span class="glyphicon glyphicon-tasks"></span>
                        应用权限
                    </div>
                    <ul class="list-group">
                        @foreach (var scope in Model.ResourceScopes)
                        {
                            @Html.Partial("_ScopeListitem", scope);
                        }

                    </ul>
                </div>
            }

            <div>
                <label><input type="checkbox" asp-for="RemeberConsent" /></label>
                <strong>记住选择</strong>
            </div>
            <div>
                <button value="yes" class="btn btn-primary" name="button">同意</button>
                <button value="no" class="btn " name="button">取消</button>
                @if (!string.IsNullOrWhiteSpace(Model.ClientUri))
                {
                    <a href="@Model.ClientUri" class="pull-right btn btn-default">
                        <span class="glyphicon glyphicon-info-sign"></span>
                        <strong>@Model.ClientUri</strong>
                    </a>
                }
            </div>
        </form>

    </div>
</div>